package com.yanqu.road.server.cmd.activity.dafuweng;

import com.yanqu.road.pb.monopoly.MonopolyProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.activity.dafuweng.DaFuWengMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = GameProtocol.S_DA_FU_WENG_GET_RANDOM_BOSS_FROM_CROSS, desc = "跨服预处理boss事件")
public class DaFuWengPreHandleBossEventFromCrossCmd extends AbstractCommand {

    private long userId;

    private int bossId;

    private int activityId;

    private int addNewsResult;

    private MonopolyProto.RollDiceRespMsg rollMsg;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        MonopolyProto.CrossPreHandleBossEventRespMsg respMsg = MonopolyProto.CrossPreHandleBossEventRespMsg.parseFrom(packet.getBytes());
        userId = respMsg.getUserId();
        bossId = respMsg.getBossId();
        activityId = respMsg.getActivityId();
        rollMsg = respMsg.getRollMsg();
        addNewsResult = respMsg.getAddNewsResult();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        DaFuWengMgr.setBossEventBoss(player, activityId, userId, bossId, rollMsg, addNewsResult);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
